package com.wn.cloud.seata.controller;

import com.wn.cloud.common.constant.ResponseEnum;
import com.wn.cloud.common.response.CommonResult;
import com.wn.cloud.seata.entity.OrderEntity;
import com.wn.cloud.seata.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @FileName: OrderController
 * @Description: TODO
 * @Author: MaWenHao
 * @Created: 2020/4/17 - 17:17
 * @Version: V1.0
 * @Company: 东方微银科技（北京）有限公司
 */
@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    public OrderService orderService;

    @GetMapping
    public CommonResult create(OrderEntity order) {
        order.setStatus(null);
        orderService.create(order);
        return CommonResult.genMessageResult(ResponseEnum.SUCCESS);
    }
}
